package com.shch.tools.configure;

import org.apache.commons.io.FileUtils;
import org.springframework.boot.CommandLineRunner;

import java.io.File;
import java.io.InputStream;

public class FileCopy implements CommandLineRunner {
    @Override
    public void run(String... args) throws Exception {
        InputStream stream = getClass().getClassLoader().getResourceAsStream("ip/GeoLiteCity.dat");
        File targetFile = new File("/usr/local/mytools/GeoLiteCity.dat");
        FileUtils.copyInputStreamToFile(stream, targetFile);
    }
}
